package com.yt.sys.service;

import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.BeanUtils;
import javax.annotation.Resource;
import com.yt.sys.common.config.YmlConfig;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yt.sys.mapper.EmployeeRoleMapper;
import com.yt.sys.models.service.IEmployeeRoleService;
import com.yt.sys.models.bo.EmployeeRoleSaveBO;
import com.yt.sys.models.dto.EmployeeRoleDTO;

/**
 * 用户角色关联控制器
 *
 * @author yzz
 * @Date 2025-10-22 09:48:29
 */
@DubboService
public class EmployeeRoleServiceImpl extends ServiceImpl<EmployeeRoleMapper, EmployeeRoleDTO> implements IEmployeeRoleService {

    @Resource
    private YmlConfig ymlConfig;

    @Override
    public boolean add(EmployeeRoleSaveBO saveBO) {
        EmployeeRoleDTO dto = new EmployeeRoleDTO();
        BeanUtils.copyProperties(saveBO,dto);
        Long id = ymlConfig.getPkId();
        dto.setId(id);
        return this.insert(dto);
    }
}
